<div class="apes-car-insurance">

  <!--车险分析-->
  <apes-card apesTitle="车险销售统计">

    <!--查询区-->
    <div apes-row [apesGutter]="16" class="apes-item" style="padding: 16px;">
      <formly-form [model]="salesModel" [fields]="salesField"></formly-form>
      <div apes-col [apesSpan]="4">
        <button apes-button [apesSize]="'default'" (click)="refreshSalesData()">刷新</button>
      </div>
    </div>

    <!--展示区-->
    <div apes-row [apesGutter]="16">

      <div apes-col [apesSpan]="8">
        <apes-charts [id]="'salesPie'" [data]="salesPieData" [option]="salesPieOption"
                     [loading]="salesPieLoading"></apes-charts>
      </div>

      <div apes-col [apesSpan]="16">
                <apes-charts [id]="'salesBar'" [data]="salesBarData" [option]="salesBarOption"
                             [loading]="salesBarLoading"></apes-charts>
      </div>

    </div>

    <div apes-row [apesGutter]="16" apesType="flex" apesJustify="center">

      <div apes-col [apesSpan]="12">

        <apes-table #rankTable
                    apesBordered
                    apesSize="small"
                    [apesScroll]="{ y: '500px' }"
                    [apesFrontPagination]="false"
                    [apesShowPagination]="false"
                    [apesLoading]="salesFormLoading"
                    [apesData]="salesFormData">
          <thead>
          <tr>
            <th style='width: 15%' [apesAlign]="'center'">统计时间</th>
            <th style='width: 15%' [apesAlign]="'center'">保险公司</th>
            <th style='width: 15%' [apesAlign]="'center'">销售总金额</th>
            <th style='width: 15%' [apesAlign]="'center'">商业险金额</th>
            <th style='width: 15%' [apesAlign]="'center'">交强险金额</th>
            <th style='width: 12.5%' [apesAlign]="'center'">同比</th>
            <th style='width: 12.5%' [apesAlign]="'center'">环比</th>
          </tr>
          </thead>
          <tbody>
          <tr *ngFor="let data of rankTable.data">
            <td style='width: 15%' [apesAlign]="'center'">{{data.STATISTIC_DATE}}</td>
            <td style='width: 15%' [apesAlign]="'center'">{{data.ABBREVIATION}}</td>
            <td style='width: 15%' [apesAlign]="'center'">{{data.SALE_AMOUNT}}</td>
            <td style='width: 15%' [apesAlign]="'center'">{{data.COMMERCIAL_INSURANCE}}</td>
            <td style='width: 15%' [apesAlign]="'center'">{{data.COMPULSORY_INSURANCE}}</td>
            <td style='width: 12.5%' [apesAlign]="'center'">{{data.YearOnYear}}</td>
            <td style='width: 12.5%' [apesAlign]="'center'">{{data.ChainRatio}}</td>
          </tr>
          </tbody>
        </apes-table>

      </div>

    </div>

  </apes-card>

</div>


